package pack0812;

public class Work2 {
    public static void main(String[] args) {
        //2：有一列乱序的字符，‘a’,‘c’,‘u’,‘b’,‘e’,‘p’,‘f’,‘z’，
        // 排序并按照英文字母表的逆序输出
        char[] array = {'a','c','u','b','e','p','f','z'};
        for(int i = 0; i<array.length-1; i++){
            for(int j = 0; j<array.length-1-i; j++){
                if(array[j]>array[j+1]){
                   char a = array[j];
                   array[j] = array[j+1];
                   array[j+1] = a;
                }
            }
        }
        for(int i = array.length-1; i>=0; i--){
            System.out.print(array[i]+"\t");
        }
    }
}
